<div>
<a href='edit.php' title='Добавить отчет'><img src='pict/add.png' border="0"/></a>
</div>

<br/>

 <b>Отчеты</b><br/>

 <table cellpadding=0 cellspacing=0 border=0 class='txt' width='100%'>
  <?
   $Queries = ReportMgr::getQueryList();

    $q=false;

     if (isset($_GET['q']))
     {
     $q = intval($_GET['q']);

     $ParentNodes =  ReportMgr::getParentNodesList($q);
     }

   foreach($Queries as $query)
   {
     $bold1 = '';
     $bold2 = '';
    if (($q) && (($q==$query->id) ))
    {
          $bold1 = '<b>';
          $bold2 = '</b>';
    }

           ?>
           <tr>
           <td style='padding-bottom:5px; padding-left:10px;'><a href='index.php?q=<?=$query->id ?>'><?=$bold1 ?>  <?=$query->name ?> <?=$bold2 ?></a>

                <?

           if (($q) && (($q==$query->id) || ( array_search($query->id, $ParentNodes) )))
           {

             ReportMgr::WriteNode($query->id, $ParentNodes);

           }

           ?>
           </td>
           </tr>
           <?
   }
  ?>

     </table>